package com.dzx.design.structural.adapter;

/**
 * @author dzx
 * @ClassName:
 * @Description:
 * @date 2019年08月01日 17:37:08
 */
public class PowerAdapter implements DC5 {
    private AC220 ac220 = new AC220();

    @Override
    public int outputDC5V() {
        int adapterInput = ac220.outputAC220V();//220v
        //经过变压器转换成5v
        int adapterOutput = adapterInput / 44;
        System.out.println("使用变压器输入AC:" + adapterInput + "v" + "输出DC:" + adapterOutput + "v");
        return adapterOutput;
    }
}
